function hasRole(role) {
  const userJson = localStorage.getItem('user')
  if (!userJson) return false
  const user = JSON.parse(userJson)
  if (user.role === role) {
    return true
  }
  return false
}
export { hasRole }
